﻿using _2008A.PH5._0221_0317.FuXi.EFCore;
using _2008A.PH5._0221_0317.FuXi.IRespository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2008A.PH5._0221_0317.FuXi.Respository
{
    public class UnitOfWork : IUnitOfWork
    {
        //public FuXiDbContext context { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }

        private FuXiDbContext _context;
        public UnitOfWork(FuXiDbContext _context) 
        {
            this._context  = _context;
        }

        public FuXiDbContext GetDbContext()
        {
            return _context;
        }

        public int SaveChanges()
        {
            var result =this._context.SaveChanges();
            return result;
        }
    }
}
